#ifndef COLLAPSEVIEW_H
#define COLLAPSEVIEW_H

#include <QWidget>
#include "collapseviewitem.h"
#include "moveableframelesswindow.h"
#include <QListWidget>

namespace Ui {
class CollapseView;
}

class CollapseView : public QWidget
{
    Q_OBJECT

public:
    explicit CollapseView(int wsfd,QWidget *parent = 0);
    ~CollapseView();
    /**
     * @brief addCollapse
     * @param fd
     * @param uuid
     * @param nickname
     */
    void addCollapse(int fd,QString uuid,QString nickname,QString mood);
    void delCollapse(int fd,QString uuid,QString nickname);
    void closeCollapses();
    void readMessage(WS_MESSAGE msg);
    void onThemeColorChange(QString colorStr);
    /**
     * @brief addItem 添加一个项
     * @param uuid
     * @param text
     * @return
     */
    LitterIem* addItem(int fd,QString uuid,QString text,QString mood);
private slots:
    void butClick();

private:
    Ui::CollapseView *ui;
    QList<CollapseViewItem*> collapsGroup;

public:
    QMap<QString,clientItem*> m_clientMap;

protected:
    int m_wsfd;

protected slots:
    void onTalkWindowItemClicked(int  fd,QString uuid);
signals:
    void explains();
    void sigTalkWindow(int fd,QString uuid);
};

#endif // COLLAPSEVIEW_H
